﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/BodyMasterPage.Master"
    CodeBehind="wfFeriadoBnd.aspx.cs" Inherits="RH.wfFeriadoBnd" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../Styles/jquery-ui.custom.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function ResizeGrid() {
            internalGridResize("<%= grdList.ClientID %>");
        }
        
        $(document).ready(function () {
            Sys.Application.add_load(page_load);
        });

        function page_load() {
            var menuTable = document.getElementById('<%=mnuToolbar.ClientID %>');
            var menuLinks = menuTable.getElementsByTagName("a");
            if (menuLinks != null) {
                switch (menuLinks.length) {
                    case 2:
                        menuLinks[0].onclick = function () { return validateEditForm('_BTTSAVE') }
                        break;

                    case 3:
                        menuLinks[0].onclick = function () { return validateEditForm('_BTTSAVE') }
                        menuLinks[1].onclick = function () { return validateEditForm('_BTTSAVNEW') }
                        break;
                }
            }

            ResizeGrid();
            MessageOnPostback();

        }
        
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="ToolBar">
        <asp:Menu ID="mnuToolbar" runat="server" CssClass="ToolBarControl" Orientation="Horizontal"
            OnMenuItemClick="mnuToolbar_MenuItemClick">
            <Items>
                <asp:MenuItem Text="Guardar" Value="_BTTSAVE" ImageUrl="../Images/Icons/Enabled/SAVE.png">
                </asp:MenuItem>
                <asp:MenuItem Text="Salir" Value="_BTTEXIT" ImageUrl="../Images/Icons/Enabled/BACK.png">
                </asp:MenuItem>
            </Items>
        </asp:Menu>
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="DataHeader">
                <table id="TableDataHeader" cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="3">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 5px">
                            &nbsp;
                        </td>
                        <td>
                            Datos Feriado
                        </td>
                        <td style="width: 5px">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 5px">
                            &nbsp;
                        </td>
                        <td>
                            <div style="border: 1px solid #ccc; border-radius: 5px; -moz-border-radius: 5px;
                                -webkit-border-radius: 5px; -ms-border-radius: 5px;">
                                <table width="100%" cellpadding="0" cellspacing="2">
                                    <tr>
                                        <td colspan="13">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 5px">
                                            &nbsp;
                                        </td>
                                        <td style="width: 110px;">
                                            Fecha:
                                        </td>
                                        <td style="width: 200px;">
                                            <esd:esdDateTextBox ID="txtfeFeriado" runat="server" Width="100px"></esd:esdDateTextBox>
                                        </td>
                                        <td colspan="9">
                                            <esd:esdButton ID="bttAgregar" runat="server" OnClick="bttAgregar_Click" Text="Agregar"
                                                Width="80px"></esd:esdButton>
                                        </td>
                                        <td style="width: 5px">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 5px">
                                            &nbsp;
                                        </td>
                                        <td>
                                        </td>
                                        <td colspan="10">
                                        </td>
                                        <td style="width: 5px">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="13">
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                        <td style="width: 5px">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </div>
            <div class="DataDetail">
                <table width="100%" cellpadding="0" cellspacing="2">
                    <tr>
                        <td style="width: 5px">
                            &nbsp;
                        </td>
                        <td>
                            <esd:esdGridView CssClass="esdGridView" ID="grdList" runat="server" ScrollWidth="100%"
                                Width="100%" ShowHeaderWhenEmpty="True" AutoGenerateColumns="False" OnRowCommand="grdList_RowCommand"
                                OnRowDataBound="grdList_RowDataBound" DataKeyNames="idPeriodo,feFeriado">
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="grdBttCmdDelete" CommandName="CmdDel" CommandArgument="<%# Container.DataItemIndex %>"
                                                runat="server" ImageUrl="../Images/Icons/Enabled/Delete.png" ToolTip="Eliminar Remuneración" />
                                        </ItemTemplate>
                                        <HeaderStyle Width="22px" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="feFeriado" HeaderText="Feriado" DataFormatString="{0:dd/MM/yyyy}">
                                    </asp:BoundField>
                                    <asp:BoundField DataField="stAnulado" HeaderStyle-CssClass="hideDataGridColumn" ItemStyle-CssClass="hideDataGridColumn">
                                    </asp:BoundField>
                                </Columns>
                                <EmptyDataTemplate>
                                    <div id="gridempty">
                                        <asp:Image ID="imgEmpty" runat="server" ImageUrl="../Images/Controls/Attention.png" />
                                        &nbsp;No existen registros para esta solicitud.
                                    </div>
                                </EmptyDataTemplate>
                            </esd:esdGridView>
                        </td>
                        <td style="width: 5px">
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </div>
            <asp:HiddenField ID="hdnMsgOPB" runat="server" />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="mnuToolbar" EventName="MenuItemClick" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
